import "./assets/main.css";
// import './assets/framework/font-awesome/css/font-awesome.min.css'
import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import axios from "axios";
import ElementPlus from "element-plus";
import { getSessionStorage } from "./utils/common";
router.beforeEach(function (to, from, next) {
  let users = getSessionStorage('doctor');
  //除了登录、注册之外，都需要判断是否登录
  if (!(to.path == "/" || to.path == "/login" || to.path == "/register")) {
    if (users == null) {
      router.push("/login");
    }
  }
  next();
});

const app = createApp(App);

app.use(createPinia());
app.use(router);
app.use(ElementPlus);
app.mount("#app");
